package com.zk.shop.servlet.goods;

import com.zk.shop.entity.Goods;
import com.zk.shop.service.GoodsService;
import com.zk.shop.service.Impl.GoodsServicesImpl;
import com.zk.shop.util.JSONServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @version 1.0
 * @ClassName GetAllGoodsBySundryServlet
 * @Description TODO
 * @Author 关轶阳
 * @Date 2019/10/13 0013 上午 10:52
 */
@WebServlet("GetAllGoodsBySundryServlet")
public class GetAllGoodsBySundryServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        GoodsService goodsService=new GoodsServicesImpl();
        List<Goods> goodsList =goodsService.getAllGoodsBySundry();
        JSONServlet.getJson(request,response,goodsList);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
